package com.duanyf.wiki.controller;


import com.duanyf.wiki.domain.Test;
import com.duanyf.wiki.service.TestService;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: duanyf
 * @DateTime: 2022/9/15 0015 22:46
 */
@RestController
public class TestController {

  @Value("${test.hello:TEST}")
  private String testHello;

  @Resource
  private TestService testService;

  @GetMapping("/hello")
  public String hello(){
    return "hello world"+testHello;
  }

  @PostMapping("/hello/post")
  public String hellopost(String name){
    return "hello world post"+name;
  }

  @GetMapping("/test/list")
  public List<Test> list(){
    return testService.list();
  }
}
